<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script src="https://og6593g2z.qnssl.com/fundebug.0.3.3.min.js" apikey="f425f662987ebb7ba8943b7db3a296603e9d5a91ad9fefd25f16a1923106bf9a"></script>
    <script src="__LAYUI__/layui.js"></script>
    <link href="__LAYUI__/css/layui.css" rel="stylesheet"/>
    <link href="__CSS__/index.css" rel="stylesheet"/>
    <style>
        .index1 {
            text-align: center;
        }

        .index1 div a {
            text-align: center;
            width: 215px;
            height: 315px;
            margin: 0 17px 74px 17px;
            float: left;
            border: #e8e8e8 solid 1px;
        }

        .index1_img {
            width: 217px;
        }

        .index1_img img {
            width: 171px;
            height: 129px;
            margin-top: 35px;
        }

        .index1_title {
            margin-top: 40px;
        }

        #company a {
            display: block;

        }
    </style>
    <!-- <load href='../res/css/index.css'> -->
</head>
<body>


<div id="header" class="layui-header head">
    <div class="layui-main">
        <a style="position: absolute;left: 0;top: 16px;" href="#">
            <img style="height: 81px;display: inline-block;border: none;"
                 src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=113436625,2630828831&fm=27&gp=0.jpg">
        </a>
        <div style="padding-top: 51px">
            <ul class="layui-nav" style="right: 0; position: absolute;" lay-filter="filter">
                <li class="layui-nav-item layui-this"><a href="javascript:void(0);">首页</a></li>
                <li class="layui-nav-item" name="login"><a href="javascript:void(0);">登陆</a></li>
            </ul>
        </div>
        <script>
            layui.use('layer', function () {
                var layer = layui.layer;

                // layer.msg('hello');
            });
            //注意：导航 依赖 element 模块，否则无法进行功能性操作
            layui.use('element', function () {
                var element = layui.element;

                //…
                element.on('nav(filter)', function (data) {
                    var att = data.attr('name');
                    if (att == 'login') {
                        layui.use(['jquery', 'layer'], function () {
                            var $ = layui.$ //重点处
                                , layer = layui.layer;
                            var url = '/index/Database/userLogin';
                            $.post(url, function (data) {
                                var user = JSON.parse(JSON.stringify(data));
                                if (user.code == "4") {
                                    if (user.level == '0') {
                                        window.location.href = '/index/Adm/admin';
                                    } else {
                                        window.location.href = '/index/Sta/staff';
                                    }
                                } else {
                                    layui.use('layer', function () {
                                        var layer = layui.layer;
                                        layer.open({
                                            type: 2,
                                            title: '登陆',
                                            scrollbar: false,
                                            resize: false,
                                            area: ['400px', '280px'],
                                            shadeClose: true,
                                            content: ['/index/index/login', 'no'],
                                            end: function () {

                                            }
                                        });
                                        // layer.msg('hello');
                                    });
                                }
                            });
                        });
                    }
                });
            });
        </script>
    </div>
</div>

<div id="carousel" style="height: 520px">
    <div class="layui-carousel" id="test1">
        <div carousel-item>
            <div style="background: snow">
                <img src="./static/img/1483416279979.jpg" style="height: 100% ;width: 100%">
            </div>
            <div style="background: salmon">
                <img src="./static/img/1483416282971.jpg" style="height: 100% ;width: 100%">
            </div>
            <div style="background: paleturquoise">
                <img src="./static/img/1483416260973.jpg" style="height: 100% ;width: 100%">
            </div>
            <div style="background: navy">
                <img src="./static/img/1483416247972.jpg" style="height: 100% ;width: 100%">
            </div>
            <div style="background: #9F9F9F">
                <img src="./static/img/1483416305972.jpg" style="height: 100% ;width: 100%">
            </div>
        </div>
    </div>
    <!-- 条目中可以是任意内容，如：<img src=""> -->

    <!--<script src="/static/build/layui.js"></script>-->
    <script>
        layui.use('carousel', function () {
            var carousel = layui.carousel;
            //建造实例
            carousel.render({
                elem: '#test1'
                , width: '100%' //设置容器宽度
                , arrow: 'hover' //始终显示箭头
                , height: '520px'
                //,anim: 'updown' //切换动画方式
            });
        });
    </script>
</div>


<div class="service">
    <div class="index_title">
        <div class="index_title_text1">出版社</div>
    </div>
    <div class="layui-container  about_text" style="text-align: center">
        <div class="layui-row index1 ">
            <div class="layui-col-md" style="height: 500px;text-align: center; vertical-align:middle" id="company">
                <div style="text-align: center; height: 100%;width: 1004px;margin: auto">
                    <a href="#" id="index_company_url1">
                        <div>
                            <div class="index1_img">
                                <div><img src="" id="index_company_img1"></div>
                            </div>
                            <div class="index1_title" id="index_company1"></div>
                            <div class="index1_bottom">
                                <div></div>
                            </div>
                        </div>
                    </a>

                    <a href="#" id="index_company_url2">
                        <div>
                            <div class="index1_img">
                                <div><img src="" id="index_company_img2"></div>
                            </div>
                            <div class="index1_title" id="index_company2"></div>
                            <div class="index1_bottom">
                                <div></div>
                            </div>
                        </div>
                    </a>

                    <a href="#" id="index_company_url3">
                        <div>
                            <div class="index1_img">
                                <div><img src="" id="index_company_img3"></div>
                            </div>
                            <div class="index1_title" id="index_company3"></div>
                            <div class="index1_bottom">
                                <div></div>
                            </div>
                        </div>
                    </a>

                    <a href="#" id="index_company_url4">
                        <div>
                            <div class="index1_img">
                                <div><img src="" id="index_company_img4"></div>
                            </div>
                            <div class="index1_title" id="index_company4"></div>
                            <div class="index1_bottom">
                                <div></div>
                            </div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
    layui.use('jquery', function () {
        var $ = layui.$;


        $.post('/index/company/getCompany', function (res) {
            if (res.code) {
                console.log(res.msg);
                $.each(res.data, function (idx, obj) {
                    if (idx == 0) {
                        $('#index_company1').html(obj.company_name);
                        $('#index_company_url1').attr('href', obj.company_url);
                        $('#index_company_url1').attr('target', '_blank');
                        $('#index_company_img1').attr('src', obj.company_logo);
                    }
                    if (idx == 1) {
                        $('#index_company2').html(obj.company_name);
                        $('#index_company_url2').attr('href', obj.company_url);
                        $('#index_company_url2').attr('target', '_blank');
                        $('#index_company_img2').attr('src', obj.company_logo);
                    }
                    if (idx == 2) {
                        $('#index_company3').html(obj.company_name);
                        $('#index_company_url3').attr('href', obj.company_url);
                        $('#index_company_url3').attr('target', '_blank');
                        $('#index_company_img3').attr('src', obj.company_logo);
                    }
                    if (idx == 3) {
                        $('#index_company4').html(obj.company_name);
                        $('#index_company_url4').attr('href', obj.company_url);
                        $('#index_company_url4').attr('target', '_blank');
                        $('#index_company_img4').attr('src', obj.company_logo);
                    }
                });
            }

        });
    })
</script>


<div class="pro">
    <div class="index_title">
        <div class="index_title_text2">产品中心</div>
    </div>
    <div class="about_text">

    </div>
</div>
<div class="about">
    <div class="index_title">
        <div class="index_title_text1">公司简介</div>
    </div>
    <div class="about_text">

    </div>
</div>
<div id="footer" class="footer">
    <div class="layui-main">
        <div class="footer1">
            <div class="f_left footer1_left">
                <div class="footer1_title">关于我们</div>
                <div class="footer1_text">
                    <a href="#">公司简介</a>
                </div>
            </div>
            <div class="f_left footer1_left">
                <div class="footer1_title">技术优势</div>
                <div class="footer1_text">
                    <a href="#">基础知识</a>
                    <a href="#">资料文档</a>
                </div>
            </div>
            <div class="f_left footer1_left">


            </div>
            <div class="f_right footer1_right">
                <div class="footer1_title">联系我们</div>
                <div class="footer1_text">
                    <table style="margin: 10px 0 0 20px;line-height: 28px;display: block;" width="202px">
                        <tr>
                            <td>电话</td>
                            <td style="width: 77%;">0312 6294510</td>
                        </tr>
                        <tr>
                            <td>微信</td>
                            <td></td>
                        </tr>
                    </table>
                </div>

            </div>
        </div>
    </div>
    <div class="footer2">

    </div>
</div>


</body>
</html>